coroutine and generator
@mame https://mametter.hatenablog.com/entry/2019/03/27/211140
@bonotake https://bonotake.hatenablog.com/entry/2019/03/28/032324#1980年時のコルーチンの定義-と-Pythonコルーチン
"Design of a Separable Transition-Diagram Compiler", Conway ME http://melconway.com/Home/pdf/compiler.pdf
"Coroutines for Go", Cox R https://research.swtch.com/coro
Generators provide less power than coroutines, because only the top-most frame in the coroutine is allowed to yield. That frame is moved back and forth between an object and the call stack to suspend and resume it.
“A History of CLU”, Liskov B http://publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TR-561.pdf
Iterators were inspired by a construct in Alphard called a "generator".
A CLU iterator is a single operation that yields its results incrementally. For example,
elements = iter (s: set[t]) yields (t)
produces all the elements in set s, but it yields them one at a time. An iterator is called in a for statement:
for x: int in set[int]$elements(coll) do
"Abstraction and Verification in Alphard" Defining and Specifying Iteration and Generators", Shaw M https://dl.acm.org/doi/pdf/10.1145/359763.359782